//FOConnect.configs.baseIdUrl = 'http://qc.id.banbe.net';
//FOConnect.configs.basePluginsUrl = 'http://qc.plugins.banbe.net'; 
//FOSP._config.baseUrl = 'http://qc.plugins.banbe.net';
//FOSP._config.idUrl = 'http://qc.id.banbe.net/';

$(document).ready(function(){
	//Set_Cookie('fospconnect', 'a');
	FOConnect.init({
		//required params
		consumerkey: Drupal.settings.consumer_key,
		receiver : Drupal.settings.receiver,
		domain : Drupal.settings.domain,
//		consumerkey: '309c181dd8a989f0bfa0ce793cddda24',
//		receiver : 'ione.net/xd_receiver.html',
//		domain : 'ione.net',
		logouturl : '/user',
		loginNodeId : 'btn_banbe_login', // the ID of DOM node where FOC login button will display
		loginNodeText : 'Login using BanBe.net account',		
		logoutNodeText : 'Login using BanBe.net account',
		registerNodeId : 'btnRegister', // the ID of DOM node where FOC register a new account button will display
				
		//option params			
		autoSynSessionTimeout : 10,
		autoSynSessionCallback : function(status){
			if(!status){					
				FOConnect.logout();
				return true;
			}
			return false;
		}
	});
	
	var userInfoHandler = function(user){
		if(user !== false){
			//document.getElementById('fullname').innerHTML =  user.fullname;
			//document.getElementById('userAvatar').setAttribute('src' , "http://banbecdn.net"+user.avatar.replace('.jpg','_50x50.jpg'));
		}else {
		}
	};
	FOConnect.loginCallbacks.push(userInfoHandler);		
	
	FOConnect.logoutCallbacks.push(function(){
		//document.getElementById('userAvatar').style.display = 'hide';		
	});
});
